local ClientOHOH = _G.ClientOHOH;
local M = ClientOHOH.class.new(script, ClientOHOH.files.BaseComponent());
local CallBackManager = ClientOHOH.load.CallBackManager();
local InstanceManager = ClientOHOH.load.InstanceManager();
function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);

    local GoldenPart=ClientOHOH:GetPath_Loop("PetMake.Golden.touch",game.Workspace)


	CallBackManager:AddRbxConnect(self,GoldenPart.Touched, function(obj,chPart)
		if not _G.CommonOHOH.load.GeneralTool().IsMeTouchEvent(chPart,"LeftLowerLeg") then
			return 
		end
        self:ShowGolden()

	end);

	-- CallBackManager:AddRbxConnect(self,GoldenPart.TouchEnded, function(obj,chPart)
	-- 	if chPart.Name~="LeftLowerLeg" then
	-- 		return
	-- 	end
    --     self:HideGolden()
	-- end);


    
    local VoidPart=ClientOHOH:GetPath_Loop("PetMake.Void.touch",game.Workspace)

	CallBackManager:AddRbxConnect(self,VoidPart.Touched, function(obj,chPart)

		if not _G.CommonOHOH.load.GeneralTool().IsMeTouchEvent(chPart,"LeftLowerLeg") then
			return 
		end
        self:ShowVoid()

	end);

	-- CallBackManager:AddRbxConnect(self,VoidPart.TouchEnded, function(obj,chPart)
	-- 	if not _G.CommonOHOH.load.GeneralTool().IsMeTouchEvent(chPart,"LeftLowerLeg") then
	-- 		return 
	-- 	end
    --     self:HideVoid()
	-- end);

end


function M.ShowGolden(self)
    ClientOHOH.load.UIManager().ui_list.PetGoldGui:Show()
    
end

function M.HideGolden(self)

    ClientOHOH.load.UIManager().ui_list.PetGoldGui:Hide()
end


function M.ShowVoid(self)
    ClientOHOH.load.UIManager().ui_list.PetVoidGui:Show()

end

function M.HideVoid(self)
    ClientOHOH.load.UIManager().ui_list.PetVoidGui:Hide()
end



function M.dtor(self)
	M.super.dtor(self);
end

return M

